/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aso.upna.filesystem;
import aso.upna.cancion.*;
import java.util.Vector;

/**
 *
 * @author triki
 */

public class FileIterator {

    private Vector privateVector;
    private int counter;

    public FileIterator(Vector array)
    {
        counter = 0;
        this.privateVector = array;
    }

    public boolean hasNext()
    {
        if(counter+1 <= privateVector.size())
            return true;
        else
            return false;
    }

    public AbstractCancion current()
    {
        return (AbstractCancion) privateVector.get(counter);
    }

    public void next()
    {
        counter+=1;
    }

    public void previous()
    {
        counter-=1;
        
        if(counter < 0)
            counter = 0;
    }

    public int count_elements()
    {
        return privateVector.size();
    }

    public void first()
    {
        counter = 0;
    }
}
